import { App } from "vue";
import { useStore } from "../store/login";
export const regPermission = (app: App<Element>) => {
  app.directive("permission", {
    // 某个生命周期里面，判断 当前 userStore 里面是否有 传入的 value
    mounted(el, binding) {
      const store = useStore();
      if (!store.permissions.includes(binding.value)) {
        el.remove();
      }
    },
  });
};
